<template>
  <div class="product-container">
    <div class="product-header">
      <h1>商品管理</h1>
      <el-button type="primary" size="small">添加商品</el-button>
    </div>
    
    <el-table :data="products" style="width: 100%">
      <el-table-column prop="id" label="编号" width="80"></el-table-column>
      <el-table-column prop="name" label="名称"></el-table-column>
      <el-table-column prop="price" label="价格" width="120"></el-table-column>
      <el-table-column prop="stock" label="库存" width="100"></el-table-column>
      <el-table-column label="操作" width="200">
        <template slot-scope="scope">
          <el-button size="mini" type="primary" @click="editProduct(scope.row)">编辑</el-button>
          <el-button size="mini" type="danger" @click="deleteProduct(scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
export default {
  name: 'MerchantProduct',
  data() {
    return {
      products: []
    }
  },
  created() {
    // Load products
    console.log('Loading merchant products')
  },
  methods: {
    editProduct(product) {
      console.log('Edit product', product)
    },
    deleteProduct(product) {
      console.log('Delete product', product)
    }
  }
}
</script>

<style scoped>
.product-container {
  padding: 20px;
}
.product-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
</style> 